CriticalSection.TryEnter Function

Similar to Enter but returns a Boolean. Attempts to get a lock on the resource managed by the CriticalSection.

Syntax

result = CriticalSection.TryEnter( )

Return Value

Result

Boolean

Notes

If it succeeds, it returns True and the thread has exclusive use of the resource. If it fails, it returns False but does not block execution of the thread.